SftMask/OCX 7.0 FAQs

I'm using .NET (VB.NET or C#) and I get this error when I run an application with SftMask/OCX: Could not load file or assembly 'Interop.MSDATASRC, ....

Locate the Reference to MSDATASRC and set its "Embed Interop Types" to False. This reference is required, but not typically used unless VB6 style data binding is used.

How can I replace the built-in popup menu with my own?

The popup menu is displayed after the mouse is released, that means right after the MouseUp event occurs. By implementing a MouseUp event handler and using the CancelMode method, you can cancel the menu so it isn't displayed at all :

SftMask1.CancelMode

If you use the CancelMode method in the MouseUp event, the built-in menu is not displayed and you can perform any other type of processing, including displaying your own popup menu.

How can I translate all input to uppercase?

Depending on how the control is used, one of the following methods will translate all input to uppercase.

Masked Edit Control

If you are using a mask (defined by the Mask property), you can use the <u token (see Special Handling Tokens in the Mask property documentation).

Example:

SftMask2.Mask = "<u???>-???"
SftMask2.Caption.Text = "Part No."

Simple Edit Control

If you are not using a mask (i.e., you are using the control as a simple edit control) you can translate input in the KeyPress event as follows:

Private Sub SftMask1_KeyPress(KeyAscii As Integer)
    Dim s As String
    s = Chr(KeyAscii)
    s = UCase(s)
    KeyAscii = Asc(s)
End Sub

This technique could also be used to limit input to digits only in a simple edit control:

Private Sub SftMask1_KeyPress(KeyAscii As Integer)
    If Not IsNumeric(Chr(KeyAscii)) Then
        KeyAscii = 0
    End If
End Sub
With Delphi, why don't I get SftMask/OCX's help when I hit F1 in the IDE properties Windows or on a form with SftMask/OCX?

HTML help as provided by SftMask/OCX is not supported by Delphi and C++Builder. The product help cannot be accessed directly from the IDE. Instead, help can be invoked from the product specific property pages or the About dialog. These are accessed by right-clicking on the control at design-time.